package com.itheima.exception;

/**
 * @author 马祥和
 * @version 1.0
 * @function
 * @time 2025/7/29 15:51
 */

import com.itheima.entity.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalEceptionHandler {
    @ExceptionHandler()
    public Result doExceotion(Exception ex){
        log.error(ex.getMessage());
        return Result.error("出错了，请联系管理员");
    }
}
